<template>
  <div>
    <el-dialog :title="title" :visible.sync="open" width="50%">
      <div class="picker">
        <el-transfer v-model="result" :data="flows" :props="{key:'handleId', label:'handleName'}"
          :titles="['预案流程','演练流程']"></el-transfer>
      </div>
      <div slot="footer" class="dialog-footer">
        <el-button @click="close">取 消</el-button>
        <el-button type="primary" @click="handleConfirm">确认选择</el-button>
      </div>
    </el-dialog>
  </div>
</template>
<script>
import dialogMixin from '@/mixins/dialogMixin.js';

export default {
  name: 'DrillFlowPicker',
  mixins: [dialogMixin],
  data() {
    return {
      title: "选择处置流程",
      flows: [],
      result: []
    }
  },
  methods: {
    showDialog(flows) {
      this.result = [];
      this.flows = flows;
      this.open = true;
    },
    handleConfirm() {
      if (this.result.length == 0) {
        this.$modal.msgError('请先选择流程');
        return false;
      }
      this.$emit('handleOk', this.result);
      this.open = false;
    }
  }
}
</script>
<style lang="scss" scoped>
.picker {
  display: flex;
  justify-content: center;
}
</style>